var http = require('http');
var https = require('https');

http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/html; charset= utf-8','Access-Control-Allow-Origin':'*'});
  const options = {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Cookie': 'token=-oVAtAYRwR1RpLsc09UXRVZVrWoAAAAARgwAAGmvPmkHSfkM0KY0leErzrRhIf4ha_mv1Kfh6GQRKh56IMWr-nvUNJwEkOeDpoQjfQ'
    }
  };
  var req=https.request('https://gamebox-fin.meituan.com/api/cardholder/api/activity/participateActivity',options,function(req,res){
    var html='<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"></head>'
    html+='<body><h3 style="word-break: break-all;">';
    req.on('data',function(data){
      html+=data;
    });
    req.on('end',function(){
      html+='</h3></body></html>'
      response.end(html);
    });
  })
  req.write('{"cardMetaId":"7","activityId":"20","riskLevelMap":{}}')
  req.end()
}).listen(8888);
